package com.bolt.auth.security.common.exception;

import com.bolt.convention.data.code.ServiceCode;
import lombok.Getter;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;

/**
 * Created by Administrator on 2019/9/3.
 */
public class Auth2Exception extends OAuth2Exception {
    @Getter
    protected String code;

    public Auth2Exception(String msg, Throwable t) {
        super(msg, t);
    }

    public Auth2Exception(String msg, String errorCode) {
        super(msg);
        this.code = errorCode;
    }


    public Auth2Exception(ServiceCode respCode, Throwable cause) {
        super(respCode.message(), cause);
        this.code = respCode.code();
    }
}

 